package com.dycong.common.reflect.aop.annotation.Around;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Order(1000)
@Aspect
@Component
public class GreetingAspect {


    @Around("@annotation(Spring.aop.annotation.Around.Tag)")
    public Object around(ProceedingJoinPoint pjp) throws Throwable {

        before();
//        Object[] objects=new Object[]{"girl","A3"};
//        Object result = pjp.proceed(objects);
        Object result = pjp.proceed();
        after();
        return result;
    }

    private void before() {
        System.out.println("do somethings Before");
    }

    private void after() {
        System.out.println("do somethings After");
    }
}
